package org.jeecg.modules.dinguser.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.dinguser.entity.DiyDingUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

/**
 * @Description: 自定义钉钉用户
 * @Author: jeecg-boot
 * @Date:   2020-05-29
 * @Version: V1.0
 */
@Repository
public interface DiyDingUserMapper extends BaseMapper<DiyDingUser> {
    /**
     * 根据unionid获取ding_user
     * @param unionId
     * @return
     */
    @Select("select * from diy_ding_user where ding_unionid = #{0}")
    DiyDingUser selDingUserInfo(String unionId);

    /**
     * 根据user信息更新数据库表字段信息
     * @param user
     */
    @Update("update diy_ding_user set ding_user_id = #{user.dingUserId},del_flag = #{user.delFlag} where id = #{user.id}")
    void updateByUser(@Param("user") DiyDingUser user);
}
